package improve;

/**
 * @Author Big_white
 * @Date 2021/11/26
 */
public class Client {
    public static void main(String[] args) {
        WildDuck wildDuck=new WildDuck();
        wildDuck.fly();
        ToyDuck toyDuck = new ToyDuck();
        toyDuck.fly();
        PeKingDuck peKingDuck = new PeKingDuck();
        peKingDuck.fly();
        //动态改变某个对象的行为 北京鸭 不能飞
        peKingDuck.setFlyBehavior(new NoFlyBehavior());
        System.out.println("北京鸭的实际飞翔能力");
        peKingDuck.fly();
    }
}
